<template>
 <div class="banner">
    <van-swipe :autoplay="3000">
            <van-swipe-item v-for="item in banner" :key="item.id">
                <img :src="item.image" style="position:relative;top:-7px;"/>
            </van-swipe-item>
        </van-swipe>
 </div>
</template>

<script>
import { getBanner } from '@/api';

export default {
    data(){
        return{
            banner:[]
        }
    },
    mounted(){
        this.onBanner()
    },
    methods: {
        async onBanner(){
            let res=await getBanner();
            let {data}=res
            this.banner=data
        },
    }
}

</script>

<style lang='scss' scoped>
.banner{
    img{
        width: 100%;
    }
}
</style>
